home *** CD-ROM | disk | FTP | other *** search
/ PC Users 8 / Cd Pc Users extra 8.iso / prog / inst / listx / setup.exe / CSORT.CLS < prev    next >
Encoding:
Visual Basic class definition  |  1997-11-11  |  790 b   |  31 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "CSort"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = False
  8. Attribute VB_PredeclaredId = False
  9. Attribute VB_Exposed = False
  10. Option Explicit
  11. Implements IMSort
  12.  
  13. Public NumericSort As Boolean
  14.  
  15. Private Function IMSort_CompareColumns(ByVal Str1 As String, ByVal Str2 As String, ByVal Column As Integer) As Integer
  16.    '
  17.    ' Compare items either as integer or string
  18.    '
  19.    If (NumericSort = True) Then
  20.       IMSort_CompareColumns = CInt(Str1) - CInt(Str2)
  21.    Else
  22.       If (Str1 < Str2) Then
  23.          IMSort_CompareColumns = -1
  24.       ElseIf (Str1 > Str2) Then
  25.          IMSort_CompareColumns = 1
  26.       Else
  27.          IMSort_CompareColumns = 0
  28.       End If
  29.    End If
  30. End Function
  31.